<?php
namespace Ucmaim\Controller\Admin;
use Think\Controller;

class IndexController extends CommonController{
	public function _initialize(){
		parent::_initialize();
	}

	public function Index(){
		$this->assign('manager_name', $this->manager_info['admin_name']);
		$this->display();
	}
	public function Right(){
		$this->display();
	}

	// 清空缓存
	public function clearCache(){
		$Runtime = RUNTIME_PATH . 'Cache/' . MODULE_NAME;
		if( file_exists($Runtime) ){
			$cache_files_list = scandir($Runtime);
			foreach( $cache_files_list as $k => $v ){
				$cache_file = $Runtime . '/' .$v;
				if( is_file($cache_file) ){
					@unlink($cache_file);
				}
			}
			$this->success('缓存清除成功', U('Admin/Index'));
			exit();
		}
		$this->error('暂时没有缓存可清理', U('Admin/Index'));
	}
}
